-
-
Notifications
You must be signed in to change notification settings - Fork 12
add crossws #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add crossws #44
Conversation
|
funny thing hono node adapter has better performance than srvx, switching back leaving only crossws |
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces version 1.4.1 changes: swaps server stack to srvx with crossws-based WebSocket support, adds comprehensive HTTP response mapping utilities, implements a WebSocket adapter and lifecycle integration, updates example apps (SSE + WS), and revises dependencies and changelog. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant S as srvx Server
participant A as Elysia App
participant H as Handler(mapResponse/handleFile)
C->>S: HTTP Request
S->>A: Route dispatch
A-->>H: Handler output (value/stream/file/error)
H-->>S: Response (status, headers, body)
S-->>C: HTTP Response
note over H,S: Supports strings, JSON, streams, files, SSE, custom statuses, errors
sequenceDiagram
autonumber
participant C as Client
participant S as srvx+crossws
participant W as WS Adapter
participant A as Elysia WS Route
participant RH as handleResponse
C->>S: HTTP Upgrade (WS)
S->>W: upgrade()
W->>A: onOpen(context)
A-->>C: (optional) initial messages
loop Messages
C->>W: message (text/binary)
W->>A: onMessage(context, data)
A->>RH: produce response/error
RH-->>W: mapped WS action (send/broadcast/close)
W-->>C: send (text/binary) or close
end
C-->>W: close
W->>A: onClose(context, code/reason)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hono is using a custom We prefer compatibility first in this case |
|
Hi @SaltyAom. We had major overhauls in srvx@0.9 which added fast paths (back) for New benchmarks: https://github.com/h3js/srvx/tree/v0.9.0/test/bench-node |
Summary by CodeRabbit
New Features
Documentation
Chores